<template>
  <!-- 顶部标题 -->
  <div>
    <div :class="{ headTiele: true, bgc: temp }">
      <van-icon
        name="arrow-left"
        size="25px"
        color="#000"
        @click="$router.go(-1)"
      />
      <p>{{ $parent.title }}</p>
      <van-icon
        name="ellipsis"
        size="25px"
        color="#000"
        @click="showShare = true"
      />
    </div>
    <share-page :showShare="showShare"></share-page>
  </div>
</template>

<script>
// 分享面板
import sharePage from "../common/sharePage.vue";
export default {
  data() {
    return {
      temp: false,
      showShare: false, // 分享面板显示
    };
  },
  created() {
    if (this.$route.path === "/register" || this.$route.path === "/myHome") {
      this.temp = true;
    }
  },
  methods: {
    // 分享面板显示
    isShow() {
      this.showShare = false;
    },
  },
  components: {
    sharePage,
  },
};
</script>

<style lang="scss" scoped>
.headTiele {
  position: fixed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 48px;
  padding: 0 11px;
  box-sizing: border-box;
  background-color: #f7f7f7;
  z-index: 50;

  p {
    font-size: 18px;
    color: #000;
  }
}
.bgc {
  background-color: #fff;
}
</style>
